package com.nowcoder.code.lcof;

public class JZ21 {

    public int[] reOrderArray(int[] array) {

        int[] res = new int[array.length];

        int j = 0;
        for (int i = 0; i < array.length; i++) {
            if (array[i] % 2 == 1) {
                res[j] = array[i];
                j++;
            }
        }

        for (int i = 0; i < array.length; i++) {
            if (array[i] % 2 == 0) {
                res[j] = array[i];
                j++;
            }
        }
        return res;

    }

}
